package com.asia5b.a5mall.order.adapter

import android.text.TextUtils
import android.widget.LinearLayout
import android.widget.TextView
import com.asia5b.a5mall.middleware.model.bean.SelectText
import com.asia5b.a5mall.order.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/5/7.
 */
class PlaceSelectAdapter<T : SelectText>(list:ArrayList<T>):
BaseQuickAdapter<T,BaseViewHolder>(R.layout.item_placeselect_adapter,list){
    var selectText: String? = null
    override fun convert(helper: BaseViewHolder, item: T) {
        helper.setText(R.id.tv_placeselect_content,item.getText())
        val tv_placeselect_content=helper.getView<TextView>(R.id.tv_placeselect_content)
        val ll_placeselect_content=helper.getView<LinearLayout>(R.id.ll_placeselect_content)
        ll_placeselect_content.isSelected=(TextUtils.equals(item.getText(),selectText))
    }
}